home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / SLRegion.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.1 KB  |  104 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                SLRegion.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef SLREGION_H
  11. #define SLREGION_H
  12.  
  13. #ifndef FWSTDDEF_H
  14. #include "FWStdDef.h"
  15. #endif
  16.  
  17. #ifndef SLPTRECT_H
  18. #include "SLPtRect.h"
  19. #endif
  20.  
  21. #ifndef SLSTRMRW_H
  22. #include "SLStrmRW.h"
  23. #endif
  24.  
  25. // ----- OpenDoc Includes -----
  26.  
  27. #ifndef FWODTYPS_H
  28. #include "FWODTyps.h"
  29. #endif
  30.  
  31. //========================================================================================
  32. //    Region functions
  33. //========================================================================================
  34.  
  35. // Export or Import functions for CFM-68K [sfu]
  36.  
  37. #if defined(FW_ODFLIB_IMPORT)
  38. #pragma import on
  39. #elif defined(FW_ODFLIB)
  40. #pragma export on
  41. #endif
  42.  
  43. FW_EXTERN_C_BEGIN
  44.  
  45. // ----- Region creation
  46.  
  47. ODRgnHandle        SL_API    FW_NewRegion();
  48. ODRgnHandle        SL_API    FW_CreateRectRegion(const FW_SRect& rect);
  49. ODRgnHandle        SL_API    FW_CreateOvalRegion(const FW_SRect& oval);
  50. ODRgnHandle        SL_API    FW_CreateRoundRectRegion(const FW_SRect& oval, const FW_SPoint& ovalSize);
  51. ODRgnHandle        SL_API    FW_CreateArcRegion(const FW_SRect& rect, short startAngle, short arcAngle);
  52. ODRgnHandle        SL_API    FW_CreatePolygonRegion(unsigned long pointCount, const FW_SPoint* pointArray);
  53. ODRgnHandle        SL_API    FW_CreateLineRegion(const FW_SPoint& startPt, const FW_SPoint& endPt, const FW_SPoint& lineThickness);
  54.  
  55. // ----- Dispose
  56.  
  57. void            SL_API    FW_DisposeRegion(ODRgnHandle rgnHandle);
  58.  
  59. // ----- Copy
  60.  
  61. ODRgnHandle        SL_API    FW_CopyRegion(ODRgnHandle srcRgn);
  62. void            SL_API    FW_CopyRegionTo(ODRgnHandle srcRgn, ODRgnHandle dstRgn);
  63.  
  64. // ----- Bounding Box
  65.  
  66. void            SL_API    FW_GetRegionBoundingBox(ODRgnHandle rgn, FW_SRect& rect);
  67.  
  68. // ----- Misc operations
  69.  
  70. void            SL_API    FW_OutlineRegion(ODRgnHandle rgn, FW_Fixed outlineSize);
  71. void            SL_API    FW_EmptyRegion(ODRgnHandle rgn);
  72. void            SL_API    FW_InsetRegion(ODRgnHandle rgn, FW_Fixed x, FW_Fixed y);
  73. void            SL_API    FW_MapRegion(ODRgnHandle rgn, const FW_SRect& srcRect, const FW_SRect& dstRect);
  74. void            SL_API    FW_OffsetRegion(ODRgnHandle rgn, FW_Fixed x, FW_Fixed y);
  75.  
  76. // ----- Tests
  77.  
  78. FW_Boolean        SL_API    FW_PointInRegion(ODRgnHandle rgn, const FW_SPoint& point);
  79. FW_Boolean        SL_API    FW_RectInRegion(ODRgnHandle rgn, const FW_SRect& rect);
  80. FW_Boolean        SL_API    FW_IsEmptyRegion(ODRgnHandle rgn);
  81.  
  82. // ----- Read/Write -----
  83.  
  84. void            SL_API    FW_WriteRegion(ODRgnHandle rgnHandle, FW_HWritableStream stream, FW_PlatformError* error);
  85. ODRgnHandle        SL_API    FW_ReadRegion(FW_HReadableStream stream, FW_PlatformError* error);
  86.  
  87. // ----- Region Operations -----
  88. ODRgnHandle        SL_API    FW_UnionRegion(ODRgnHandle rgn1, ODRgnHandle rgn2);
  89. ODRgnHandle        SL_API    FW_XorRegion(ODRgnHandle rgn1, ODRgnHandle rgn2);
  90. ODRgnHandle        SL_API    FW_SubtractRegion(ODRgnHandle rgn1, ODRgnHandle rgn2);    // rgn1 - rgn2
  91. ODRgnHandle        SL_API    FW_IntersectRegion(ODRgnHandle rgn1, ODRgnHandle rgn2);
  92.  
  93. FW_EXTERN_C_END
  94.  
  95. // For CFM-68K [sfu]
  96.  
  97. #if defined(FW_ODFLIB_IMPORT)
  98. #pragma import off
  99. #elif defined(FW_ODFLIB)
  100. #pragma export off
  101. #endif
  102.  
  103. #endif // SLREGION_H
  104.